/**
 * 
 */
package com.wskj.library.service.impl;
import java.util.List;

import com.wskj.library.dao.AdviceDao;
import com.wskj.library.dao.impl.AdviceDaoImpl;
import com.wskj.library.pojo.Advice;
import com.wskj.library.service.AdviceService;

/**
 * @author 胡洋
 * @describe 
 * @Date 2018年3月26日上午11:06:59
 * @version 1.0
 */
public class AdviceServiceImpl implements AdviceService {
     private AdviceDao adDao=new AdviceDaoImpl();

	
	@Override
	public boolean addAdvice(Advice advice) {
		int count = adDao.addAdvice(advice);
		return count>0?true:false;
	}

	
	@Override
	public boolean deleteAdviceById(int id) {
		int count = adDao.deleteById(id);
		return count>0?true:false;
	}

	
	@Override
	public Advice getAdviceById(int id) {
		
		return adDao.getAdviceById(id);
	}

	
	@Override
	public boolean updateAdvice(Advice advice) {
		int count = adDao.updateAdvice(advice);
		return count>0?true:false;
	}

	
	@Override
	public List<Advice> queryAdvices(int index, int pagesize) {
		
		return adDao.getAllAdvices(index,pagesize);
	}


	
	@Override
	public long getAdvicesCounts() {		
		return adDao.getCounts();
	}
	
}
